// 导入路由
// 替换掉BrowserRouter,由我们自主使用，任意时刻，任意文件
// import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { Router, Route, Switch } from 'react-router-dom';

// 导入页面组件
import Login from './pages/Login';
import Layout from './pages/Layout';
import AuthRoute from 'components/AuthRoute';
import history from 'utils/history';
// 配置路由规则
export default function App() {
  return (
    // BrowserRouter = Router + history
    <Router history={history}>
      <div className="App">
        {/* 路由规则 */}
        <Switch>
          <Route path="/login" component={Login}></Route>
          <AuthRoute path="/" component={Layout}></AuthRoute>
        </Switch>
      </div>
    </Router>
  );
}
